package com.authine.cloudpivot.ext.enums.inquiry;

/**
 * Created by continue on 2017/12/21.
 */
public enum QuotationStatusEnum {

    /**
     * 报价单状态
     */
    QUOTATION_0_NEW("0", "新建"),
    QUOTATION_1_APPROVE("1", "审核中"),
    QUOTATION_2_APPROVE_NO("2", "已退回"),
    QUOTATION_3_QUOTED("3", "已报价"),
    QUOTATION_4_APPROVE_BACK("4", "已还价"),
    QUOTATION_5_PICKETED("5", "已定标"),
    QUOTATION_6_CLOSE("6", "已关闭"),
    //询价商品定标后，原新建状态的报价单修改为已终止状态
    QUOTATION_7_TERMINATION("7", "已终止");

    private final String code;
    private final String des;

    private QuotationStatusEnum(String code, String des) {
        this.code = code;
        this.des = des;
    }

    public String getCode() {
        return code;
    }

    public String getDes() {
        return des;
    }

    public static QuotationStatusEnum get(String code) {
        for (QuotationStatusEnum c : QuotationStatusEnum.values()) {
            if (c.code.equals(code)) {
                return c;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return "code:" + code + ", des:" + des;
    }
}
